package com.wtwd.device.constant;

public enum FrequencyTypeEnum {

    HEARTRATE(1,"心率",MsgTypeEnum.W_HRTSTART),

    W_OXTSTART(2,"血氧",MsgTypeEnum.W_OXTSTART),

    W_BP_FREQUENCY(3,"血压",MsgTypeEnum.W_BP_FREQUENCY),

    W_EM_FREQUENCY(4,"情绪检测",MsgTypeEnum.W_EM_FREQUENCY)
    ;

    private int type;

    private String msg;

    private MsgTypeEnum msgTypeEnum;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public MsgTypeEnum getMsgTypeEnum() {
        return msgTypeEnum;
    }

    public void setMsgTypeEnum(MsgTypeEnum msgTypeEnum) {
        this.msgTypeEnum = msgTypeEnum;
    }

    FrequencyTypeEnum(int type, String msg, MsgTypeEnum msgTypeEnum) {
        this.type = type;
        this.msg = msg;
        this.msgTypeEnum = msgTypeEnum;
    }

    public static FrequencyTypeEnum getFrequencyTypeEnum(Integer type) {
        for (FrequencyTypeEnum value : FrequencyTypeEnum.values()) {
            if (type.equals(value.type)) {
                return value;
            }
        }
        return null;
    }
}
